const names = ["abc","cba","nba","mba",NaN]

if(names.indexOf("abc")!=-1){
    console.log("包含abc元素")
}

//ES7 2016
if(names.includes("abc")){
    console.log("包含abc元素")
}